package com.mysiteforme.admin.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.mysiteforme.admin.entity.News;
import com.mysiteforme.admin.dao.NewsDao;
import com.mysiteforme.admin.service.NewsService;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

/**
 * <p>
 * 新闻 服务实现类
 * </p>
 *
 * @author wangl
 * @since 2018-05-16
 */
@Service
@Transactional(rollbackFor = Exception.class)
public class NewsServiceImpl extends ServiceImpl<NewsDao, News> implements NewsService {


    @Override
    public Page<News> selectDetailArticle(Map<String, Object> map, Page<News> page) {
        List<News> list = baseMapper.selectDetailArticle(map, page);

//        //查询所属栏目的id
//        for(int i = 0; i<list.size();i++){
//            Long channelId = list.get(i).getchannelId();
//            System.out.println("================"+channelId);
//        }
        page.setRecords(list);
        return page;
    }
}
